package reflect;

import reflectAno.AutoRun;

import java.lang.reflect.Method;

public class ReflectDemo9 {
    public static void main(String[] args) throws Exception {
        Class c=Class.forName("reflect.Person");
        boolean b=c.isAnnotationPresent(AutoRun.class);
        System.out.println(b);
        Object o = c.newInstance();
        boolean b1 = c.isAnnotationPresent(AutoRunMethod.class);
        Method method = c.getMethod("watchTV");
        Method method1 = c.getMethod("sleep");
        boolean b2 = method.isAnnotationPresent(AutoRunMethod.class);
        boolean b3=method1.isAnnotationPresent(AutoRunMethod.class);
        System.out.println(b1);
        System.out.println(b2);
        System.out.println(b3);
    }
}
